<template>
  <div class="wrapper-container">
    <template v-if="jsonData">
      <Gradient :currentName="'根节点'" :currentSchema.sync="jsonData" :parentSchema.sync="jsonData" :currentIndex="1"
        :writable="true" :treeData="treeData" :globalTreeData="globalTreeData"></Gradient>
    </template>
    <template v-else> 正在开发中... </template>
  </div>
</template>

<script>
import Gradient from "./gradient.vue";
export default {
  data() {
    return {
      jsonData: null,
    };
  },
  props: {
    id: {
      type: Number,
    },
    treeData: {
      type: Array,
    },
    globalTreeData: {
      type: Array,
    },
  },
  components: {
    Gradient,
  },
  methods: {
    initJSonSchema() {
      this.jsonData = JSON.parse(
        JSON.stringify(this.$store.getters.schemaJson)
      )[this.id]
        ? JSON.parse(JSON.stringify(this.$store.getters.schemaJson))[this.id]
          .jsonSchema
        : undefined;
    },
    // 保存jsonSchema
    saveJsonSchema() {
    },
  },
};
</script>

<style lang="scss" scoped>
.wrapper-container {
  width: 100%;
  padding: 0;
}
</style>